package com.uidp.hibernatelayer;

import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.acsior.dac.impl.hibernate.vo.HibernateVO;

/**
 * Usergroups generated by hbm2java
 */
@Entity
@Table(name = "usergroups", catalog = "uidpdb")
public class UsergroupsVO extends HibernateVO {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = 6177915177737678208L;
	private Integer id;
	private String groupname;
	private String description;
	private List<UsersVO> userses;
	private List<ModulUsergroupsVO> modulUsergroupses ;

	// Constructors

	/** default constructor */
	public UsergroupsVO() {
		this.userses = new ArrayList<UsersVO>();
		this.modulUsergroupses = new ArrayList<ModulUsergroupsVO>();
	}
	

	/** minimal constructor */
	public UsergroupsVO(String groupname) {
		this.groupname = groupname;
	}

	/** full constructor */
	public UsergroupsVO(String groupname, String description,
			List<UsersVO> userses, List<ModulUsergroupsVO> modulUsergroupses) {
		this.groupname = groupname;
		this.description = description;
		this.userses = userses;
		this.modulUsergroupses = modulUsergroupses;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "groupname", nullable = false, length = 50)
	public String getGroupname() {
		return this.groupname;
	}

	public void setGroupname(String groupname) {
		this.groupname = groupname;
	}

	@Column(name = "description", length = 200)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "usergroups")
	public List<UsersVO> getUserses() {
		return this.userses;
	}

	public void setUserses(List<UsersVO> userses) {
		this.userses = userses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "usergroups")
	public List<ModulUsergroupsVO> getModulUsergroupses() {
		return this.modulUsergroupses;
	}

	public void setModulUsergroupses(List<ModulUsergroupsVO> modulUsergroupses) {
		this.modulUsergroupses = modulUsergroupses;
	}

	@Override
	public void setId(Object id) {
		// TODO Auto-generated method stub

	}

}
